* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-image: linear-gradient(to top, #7028e4 0%, #e5b2ca 100%);
}

h1 {
  z-index: 0;
  color: aliceblue;
  font-size: 5rem;
}

.box {
  z-index: 1;
  position: relative;
  width: 200px;
  height: 200px;
  transform-style: preserve-3d;
  animation: animate 20s linear infinite;
}

@keyframes animate {
  0% {
    transform: perspective(1000px) rotateX(0deg) rotateY(35deg);
  }
  100% {
    transform: perspective(1000px) rotateX(360deg) rotateY(35deg);
  }
}

.box span {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-origin: center;
  transform-style: preserve-3d;
  transform: rotateX(calc(var(--i) * 45deg)) translateZ(300px);
}

.box span img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
